<?php
/**
 * Created by PhpStorm.
 * User: Lxx<779219930@qq.com>
 * Date: 2018/11/15
 * Time: 16:53
 */

namespace app\home\model;


class WaterRecord extends Base
{
    protected $insert = [
        'create_time' => NOW_TIME,
    ];

    /**
     * 获取个人中心送水服务列表
     * $type: 1待处理 ， 2已处理
     * $len 长度，默认 0
     */
    public function getWaterList($type,$len = 0) {
        $map['is_pay'] = 1;
        if($type == 1) {
            $map['status'] = 0;
        }else {
            $map['status'] = ['in',[1,2]];
        }
        $list = $this->where($map)->order('create_time')->limit($len,6)->select();
        return $list;
    }
}